home *** CD-ROM | disk | FTP | other *** search
MathScript QuickCode script | 1997-02-09 | 6.7 KB | 263 lines |
- G4C
-
- ;
- ; QuickCode V1.6
- ;
- ; A Mathscript Icon Bar, allowing rapid access to your 10 most
- ; used formula elements.
- ;
- ; This is the GUI4CLI layer for QuickCode.rexx. Make sure
- ; QuickCode.rexx and QC_Prefs.gc are in the Mathscript:Rexx/QC dir!
- ;
- ; Chris Coulson
- ;
- ; History:
- ;
- ; 28.12.96
- ; 31.12.96 - First batch of icons done
- ; 05.01.97 - Changed env-var format
- ; 08.01.97 - Prefs editor now sets icon bar
- ; 09.01.97 - Version 1.0
- ; Changed env-var format again, it's half the size!
- ; 12.01.97 - Now opens on whatever pubscreen the Gui was last
- ; jumped onto.
- ; 13.01.97 - Version 1.1
- ; Version number bumped to correspond with QuickCode.rexx
- ; 14.01.97 - Project...Quit now does what it says :-)
- ; 17.01.97 - Wierd bug reported by Simon Ihmig. I've only managed to replicate
- ; it once, and I can't figure out why it happened... So I've added
- ; what seems to be the only possible fix, given the nature of the bug.
- ; Clear button now works again...
- ; 18.01.97 - Version 1.2
- ; Added the MxN matrix
- ; 21.01.97 - Version 1.3
- ; Added new codes from Mathscript 3.1
- ; 25.01.97 - Version 1.4
- ; I think I've fixed the other wierd bug Simon reported...
- ; Following advice from Dimitris, I've renamed most of the variables, so
- ; that they're all hopefully unique to QuickCode, and I've also removed
- ; the Quit command on closing the GUI. These changes should allow
- ; Quickcode to run happily on a system that's running other Guis.
- ; 28.01.97 - Version 1.5
- ; Now I REALLY think I've fixed that bug of Simon's...
- ; 09.02.97 - Version 1.6
- ; Removed all the absolute file paths, allowing the QC directory to be
- ; placed anywhere.
- ; Will now remove Gui4CLI on exit, if the user permits it.
- ; Cleared up some little bugs in the screen jumping code.
- ;
-
- WinBig 0 0 200 17 "QuickCode 1.6"
- WinType 11010000
-
- NoFontSense
-
- xOnLoad
- GuiLoad :qc_prefs.gc
- GuiLoad :qc_getmxn.gc
- IfExists FILE "env:.qcprefs"
- Else
- DelVar .qcprefs
- SetVar .qcprefs "lank "
- AppVar .qcprefs "lank "
- AppVar .qcprefs "lank "
- AppVar .qcprefs "lank "
- AppVar .qcprefs "lank "
- AppVar .qcprefs "lank "
- AppVar .qcprefs "lank "
- AppVar .qcprefs "lank "
- AppVar .qcprefs "lank "
- AppVar .qcprefs "lank "
- AppVar .qcprefs "Workbench "
- AppVar .qcprefs "0 "
- Copy "env:.qcprefs" "envarc:"
- EndIf
- SetVar qc_rawprefs $.qcprefs
- CutVar qc_rawprefs Cut Word 1 qcicon0
- CutVar qc_rawprefs Cut Word 1 qcicon1
- CutVar qcicon1 Cut Char 1 qc_dummy
- CutVar qc_rawprefs Cut Word 1 qcicon2
- CutVar qcicon2 Cut Char 1 qc_dummy
- CutVar qc_rawprefs Cut Word 1 qcicon3
- CutVar qcicon3 Cut Char 1 qc_dummy
- CutVar qc_rawprefs Cut Word 1 qcicon4
- CutVar qcicon4 Cut Char 1 qc_dummy
- CutVar qc_rawprefs Cut Word 1 qcicon5
- CutVar qcicon5 Cut Char 1 qc_dummy
- CutVar qc_rawprefs Cut Word 1 qcicon6
- CutVar qcicon6 Cut Char 1 qc_dummy
- CutVar qc_rawprefs Cut Word 1 qcicon7
- CutVar qcicon7 Cut Char 1 qc_dummy
- CutVar qc_rawprefs Cut Word 1 qcicon8
- CutVar qcicon8 Cut Char 1 qc_dummy
- CutVar qc_rawprefs Cut Word 1 qcicon9
- CutVar qcicon9 Cut Char 1 qc_dummy
- CutVar qc_rawprefs Cut Word 1 qc_screen
- CutVar qc_screen Cut Char 1 qc_dummy
-
- SetScreen quickcode.gc $qc_screen
- SetScreen qc_prefs.gc $qc_screen
- SetScreen qc_getmxn.qc $qc_screen
-
- CutVar qc_rawprefs Cut Word 1 qc_guiquit
- CutVar qc_guiquit Cut Char 1 qc_dummy
-
- Extract QuickCode.gc GuiPath qc_path
- SetVar qc_rexxprog $qc_path
- AppVar qc_rexxprog "/QuickCode.rexx"
- GuiOpen QuickCode.gc
- GoSub quickcode.gc changebuttons
- Run 'rx $qc_rexxprog'
- Wait PORT quickcode 100
-
- ; Global inits for QC_Prefs
-
- SetVar qcp_Bank 1
- SetVar qcp_Button 1
- SetVar qcp_Cmd "lank"
-
-
- xOnClose
- SendRexx quickcode "EXIT"
- GuiQuit QuickCode.gc
- GuiQuit QC_Prefs.gc
- GuiQuit QC_GetMxN.gc
- IF $qc_guiquit = 1
- Quit
- ENDIF
-
-
- xOnJump qc_screen
- SetScreen qc_prefs.gc $qc_screen
- SetScreen qc_getmxn.gc $qc_screen
- SetVar .qcprefs "$qcicon0 "
- AppVar .qcprefs "$qcicon1 "
- AppVar .qcprefs "$qcicon2 "
- AppVar .qcprefs "$qcicon3 "
- AppVar .qcprefs "$qcicon4 "
- AppVar .qcprefs "$qcicon5 "
- AppVar .qcprefs "$qcicon6 "
- AppVar .qcprefs "$qcicon7 "
- AppVar .qcprefs "$qcicon8 "
- AppVar .qcprefs "$qcicon9 "
- AppVar .qcprefs "$qc_screen "
- AppVar .qcprefs "$qc_guiquit "
- Copy "env:.qcprefs" "envarc:"
-
-
- ; Menu definitions
-
- xMenu Project About "" ""
- EzReq "QuickCode 1.6 (9th Feb 1997)\n\nby Chris Coulson\n(c.j.coulson@ncl.ac.uk)\n\nUsing Gui4CLI v2.2" "OK" Dummy
- xMenu Project Barlabel "" ""
- xMenu Project Quit "" "Q"
- GuiClose quickcode.gc
-
- xMenu Settings Change "" "C"
- GuiOpen qc_prefs.gc
-
-
-
- ; QuickCode buttons
- ;
- ; Note: xIcons MUST be first setup with an actual filename rather than a variable
- ; containing the filename - I suspect Gui4CLI tries to setup the icons before it
- ; sets up the variables. If the xIcon gadget is not initialised correctly, any
- ; attempt to ChangeIcon it at a later stage will fail.
-
- xIcon 0 0 ":icons/blank"
- GadID 1
- IF "$qcicon0" = "14/13"
- GuiOpen qc_getmxn.gc
- ELSE
- SendRexx quickcode "B0"
- ENDIF
- xIcon 16 0 ":icons/blank"
- GadID 2
- IF "$qcicon1" = "14/13"
- GuiOpen qc_getmxn.gc
- ELSE
- SendRexx quickcode "B1"
- ENDIF
- xIcon 32 0 ":icons/blank"
- GadID 3
- IF "$qcicon2" = "14/13"
- GuiOpen qc_getmxn.gc
- ELSE
- SendRexx quickcode "B2"
- ENDIF
- xIcon 48 0 ":icons/blank"
- GadID 4
- IF "$qcicon3" = "14/13"
- GuiOpen qc_getmxn.gc
- ELSE
- SendRexx quickcode "B3"
- ENDIF
- xIcon 64 0 ":icons/blank"
- GadID 5
- IF "$qcicon4" = "14/13"
- GuiOpen qc_getmxn.gc
- ELSE
- SendRexx quickcode "B4"
- ENDIF
- xIcon 80 0 ":icons/blank"
- GadID 6
- IF "$qcicon5" = "14/13"
- GuiOpen qc_getmxn.gc
- ELSE
- SendRexx quickcode "B5"
- ENDIF
- xIcon 96 0 ":icons/blank"
- GadID 7
- IF "$qcicon6" = "14/13"
- GuiOpen qc_getmxn.gc
- ELSE
- SendRexx quickcode "B6"
- ENDIF
- xIcon 112 0 ":icons/blank"
- GadID 8
- IF "$qcicon7" = "14/13"
- GuiOpen qc_getmxn.gc
- ELSE
- SendRexx quickcode "B7"
- ENDIF
- xIcon 128 0 ":icons/blank"
- GadID 9
- IF "$qcicon8" = "14/13"
- GuiOpen qc_getmxn.gc
- ELSE
- SendRexx quickcode "B8"
- ENDIF
- xIcon 144 0 ":icons/blank"
- GadID 10
- IF "$qcicon9" = "14/13"
- GuiOpen qc_getmxn.gc
- ELSE
- SendRexx quickcode "B9"
- ENDIF
-
- xButton 161 0 40 17 "CLR"
- SendRexx quickcode "BCLR"
-
-
- ; Subroutines
-
- xRoutine ChangeButtons
- ChangeIcon QuickCode.gc 1 -1 -1 ":icons/b$qcicon0"
- ChangeIcon QuickCode.gc 2 -1 -1 ":icons/b$qcicon1"
- ChangeIcon QuickCode.gc 3 -1 -1 ":icons/b$qcicon2"
- ChangeIcon QuickCode.gc 4 -1 -1 ":icons/b$qcicon3"
- ChangeIcon QuickCode.gc 5 -1 -1 ":icons/b$qcicon4"
- ChangeIcon QuickCode.gc 6 -1 -1 ":icons/b$qcicon5"
- ChangeIcon QuickCode.gc 7 -1 -1 ":icons/b$qcicon6"
- ChangeIcon QuickCode.gc 8 -1 -1 ":icons/b$qcicon7"
- ChangeIcon QuickCode.gc 9 -1 -1 ":icons/b$qcicon8"
- ChangeIcon QuickCode.gc 10 -1 -1 ":icons/b$qcicon9"
- Redraw quickcode.gc
-
-
-
-
-
-
-